package com.zc.basic.app.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zc.basic.domain.pojo.PcmcMenu;
import com.zc.basic.infra.mapper.PcmcMenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;
import java.util.Map;
import java.util.function.Function;

@Service
public class PcmcMenuService implements IService<PcmcMenu> {

    @Autowired
    private PcmcMenuMapper pcmcMenuMapper;


    /**
     * 删除菜单及其子菜单
     */
    @Transactional
    public int deleteMenu(Integer id) {
        int delete = pcmcMenuMapper.deleteMenu(id);
        return delete;
    }

    /**
     * 添加菜单
     */
    @Transactional
    public PcmcMenu addMenu(PcmcMenu pcmcMenu) {
        return pcmcMenuMapper.insertMenu(pcmcMenu);
    }


    @Override
    public boolean saveBatch(Collection<PcmcMenu> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdateBatch(Collection<PcmcMenu> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean updateBatchById(Collection<PcmcMenu> entityList, int batchSize) {
        return false;
    }

    @Override
    public boolean saveOrUpdate(PcmcMenu entity) {
        return false;
    }

    @Override
    public PcmcMenu getOne(Wrapper<PcmcMenu> queryWrapper, boolean throwEx) {
        return null;
    }

    @Override
    public Map<String, Object> getMap(Wrapper<PcmcMenu> queryWrapper) {
        return null;
    }

    @Override
    public <V> V getObj(Wrapper<PcmcMenu> queryWrapper, Function<? super Object, V> mapper) {
        return null;
    }

    @Override
    public BaseMapper<PcmcMenu> getBaseMapper() {
        return this.pcmcMenuMapper;
    }

    @Override
    public Class<PcmcMenu> getEntityClass() {
        return PcmcMenu.class;
    }
}
